home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
User's Choice Windows CD
/
User's Choice Windows CD (CMS Software)(1993).iso
/
windows1
/
al12xw.zip
/
AUTODIR.XWS
next >
Wrap
Text File
|
1991-01-23
|
29KB
|
649 lines
/*
CrossTalk for Windows AutoList Script
(C) Ashley Saldanha
1/05/1991
*/
-- Initial off-line check.
LABEL CHECKON
activate
if not online or not connected then goto setup
message "AutoList error..."
topic="Error":mess="CrossTalk is already online.":b1="&Hangup":b2="&Cancel":gosub common2
if choice=2 then end
if choice=1 then bye:goto checkon
bye:goto setup
-- Script variables and default directory name parsing. If no directory filename
-- is specified on the command line, "AUTOLIST.DIR is loaded by default. Error
-- and dialog messages share common subroutines.
LABEL SETUP
integer icon,dirfile,nil,look,x,list
integer n1,n2,n3,n4,n5,n6,n7,n8,n9,n10,n11,n12,n13,n14,n15,n16,n17,n18,n19
string d1,d2,d3,d4,d5,d6,d7,d8,d9,d10,d11,d12,d13,d14,d15,d16,d17,d18,d19
string p1,p2,p3,p4,p5,p6,p7,p8,p9,p10,p11,p12,p13,p14,p15,p16,p17,p18,p19
string y1,y2,y3,y4,y5,y6,y7,y8,y9,y10,y11,y12,y13,y14,y15,y16,y17,y18
string z1,z2,z3,z4,z5,z6,z7,z8,z9,z10,z11,z12,z13,z14,z15,z16,z17,z18
string dirname,defxwp,defdesc,dump,current,topic,mess,b1,b2
string num,xwpdir,ddesc,scrap,y,z,listdir
nil=true
look=true
eoln=chr(13)+chr(10)
curshape=0
y=" - "
dirname=arg(1)
if null(dirname) then dirname="autolist.dir"
current=upcase(dirname)
xwpdir=dirxwp
dirname=dirxwp+"\"+dirname
if length(dirxwp)>13 then xwpdir=left(dirxwp,13)
if right(xwpdir)<>"\" then xwpdir=left(dirxwp,12)
if right(xwpdir)<>"\" then xwpdir=left(dirxwp,11)
if right(xwpdir)<>"\" then xwpdir=left(dirxwp,10)
if right(xwpdir)<>"\" then xwpdir=left(dirxwp,9)
if right(xwpdir)<>"\" then xwpdir=left(dirxwp,8)
if right(xwpdir)<>"\" then xwpdir=left(dirxwp,7)
if right(xwpdir)<>"\" then xwpdir=left(dirxwp,6)
xwpdir=upcase(xwpdir)+"..."
goto read_dir
-- Create and/or read directory list file and add hyphen to description.
LABEL READ_DIR
new
if not exists(dirname) then {
message "Compiling directory list, please wait..."
dirfile=freefile
open output dirname as dirfile
close dirfile
scrap=filefind(dirxwp + "\*.xwp")
while not null(scrap)
load scrap
if not null(number) then {
defxwp=name:defdesc=description
open append dirname as dirfile
write dirfile,defxwp,defdesc
}
close dirfile
scrap=filefind
wend:new
}
dirfile=freefile
if dirfile=0 then {
message "Error..."
topic="Error":mess="Try re-installing AutoList.":gosub common1:end
}
message "Reading directory list, please wait..."
open input dirname as dirfile
while not eof(dirfile)
read #dirfile,p1,d1,p2,d2,p3,d3,p4,d4,p5,d5,p6,d6,p7,d7,p8,d8,p9,d9,p10,d10,p11,d11,p12,d12,p13,d13,p14,d14,p15,d15,p16,d16,p17,d17,p18,d18
if not eof then topic="Alert":mess="Maximum of 18 entries allowed per list.":gosub common1:goto page1
wend
close dirfile:cls
if not null(p1) then z1=y+d1 else z1=d1
if not null(p2) then z2=y+d2 else z2=d2
if not null(p3) then z3=y+d3 else z3=d3
if not null(p4) then z4=y+d4 else z4=d4
if not null(p5) then z5=y+d5 else z5=d5
if not null(p6) then z6=y+d6 else z6=d6
if not null(p7) then z7=y+d7 else z7=d7
if not null(p8) then z8=y+d8 else z8=d8
if not null(p9) then z9=y+d9 else z9=d9
if not null(p10) then z10=y+d10 else z10=d10
if not null(p11) then z11=y+d11 else z11=d11
if not null(p12) then z12=y+d12 else z12=d12
if not null(p13) then z13=y+d13 else z13=d13
if not null(p14) then z14=y+d14 else z14=d14
if not null(p15) then z15=y+d15 else z15=d15
if not null(p16) then z16=y+d16 else z16=d16
if not null(p17) then z17=y+d17 else z17=d17
if not null(p18) then z18=y+d18 else z18=d18
goto page1
-- First page dialog. Dialogs were designed with Excel's Dialog Editor
-- and depart as little as possible from CrossTalk's native dialog boxes.
LABEL PAGE1
message "AutoList Phone Book (pg.1)"
dialogbox 25,16,270,132
ltext 8,2,208,8,"Phone Book Entries in "+xwpdir+"\"+current
groupbox 8,10,208,118,""
checkbox 12,16,170,12,upcase(p1)+z1,n1,tabstop focus
checkbox 12,28,170,12,upcase(p2)+z2,n2,tabstop
checkbox 12,40,170,12,upcase(p3)+z3,n3,tabstop
checkbox 12,52,170,12,upcase(p4)+z4,n4,tabstop
checkbox 12,64,170,12,upcase(p5)+z5,n5,tabstop
checkbox 12,76,170,12,upcase(p6)+z6,n6,tabstop
checkbox 12,88,170,12,upcase(p7)+z7,n7,tabstop
checkbox 12,100,170,12,upcase(p8)+z8,n8,tabstop
checkbox 12,112,170,12,upcase(p9)+z9,n9,tabstop
defpushbutton 225,14,36,17,"&Dial",ok,tabstop group
pushbutton 225,34,36,17,"PgD&n",tabstop
pushbutton 225,54,17,14,"&+",tabstop
pushbutton 244,54,17,14,"&-",tabstop
pushbutton 225,71,36,17,"&Manual",tabstop
pushbutton 225,91,36,17,"&Options",tabstop
pushbutton 225,111,36,17,"&Close",cancel,tabstop
enddialog
if choice=7 then goto finish
if choice=6 then goto options
if choice=5 then goto manual
if choice=4 then goto untag
if choice=3 then goto tag1
if choice=2 then goto page2
if choice=1 then goto checklist
goto page1
-- Second page dialog. Additional "pages" are easily added, but increase
-- the number of variables that must be stored, with predictable consequences
-- on the execution speed of the script.
LABEL PAGE2
message "AutoList Phone Book (pg.2)"
dialogbox 25,16,270,132
ltext 8,2,208,8,"Phone Book Entries in "+xwpdir+"\"+current
ctext 225,2,36,8,"(Page 2)"
groupbox 8,10,208,118,""
checkbox 12,16,170,12,upcase(p10)+z10,n10,tabstop
checkbox 12,28,170,12,upcase(p11)+z11,n11,tabstop
checkbox 12,40,170,12,upcase(p12)+z12,n12,tabstop
checkbox 12,52,170,12,upcase(p13)+z13,n13,tabstop
checkbox 12,64,170,12,upcase(p14)+z14,n14,tabstop
checkbox 12,76,170,12,upcase(p15)+z15,n15,tabstop
checkbox 12,88,170,12,upcase(p16)+z16,n16,tabstop
checkbox 12,100,170,12,upcase(p17)+z17,n17,tabstop
checkbox 12,112,170,12,upcase(p18)+z18,n18,tabstop
defpushbutton 225,14,36,17,"&Dial",ok,tabstop group
pushbutton 225,34,36,17,"Pg&Up",tabstop
pushbutton 225,54,17,14,"&+",tabstop
pushbutton 244,54,17,14,"&-",tabstop
pushbutton 225,71,36,17,"&Manual",tabstop
pushbutton 225,91,36,17,"&Options",tabstop
pushbutton 225,111,36,17,"&Close",cancel,tabstop
enddialog
if choice=7 then goto finish
if choice=6 then goto options
if choice=5 then goto manual
if choice=4 then goto untag
if choice=3 then goto tag2
if choice=2 then goto page1
if choice=1 then goto checklist
-- The options dialog. There is a limit on the number of characters that
-- the list box can display at one time, and the final entry is blank.
LABEL OPTIONS
listdir=""
scrap=filefind(dirxwp+"\*.dir")
repeat
listdir=listdir+scrap+","
scrap=filefind
until null(scrap) or (length(listdir)>240)
scrap=filefind(dirxwp+"\*.xwp")
repeat
listdir=listdir+scrap+","
scrap=filefind
until null(scrap) or (length(listdir)>240)
message "AutoList Options"
dialogbox 25,16,270,132
groupbox 6,4,150,122,""
ctext 14,4,135,8,"CrossTalk for Windows AutoList"
ctext 8,20,145,8,"Release 1.2"
ctext 8,29,145,8,"Copyright ⌐ 1991, Ashley Saldanha"
ctext 8,45,145,8,"AutoList is freeware. It may"
ctext 8,53,145,8,"be freely used and distributed."
ctext 8,61,145,8,"Please direct comments and"
ctext 8,69,145,8,"donations to:"
ctext 8,85,145,8,"EnTech"
ctext 8,93,145,8,"RFD 1, Box 555"
ctext 8,101,145,8,"Orr's Island, Maine 04066"
ctext 8,112,145,8,"CIS 72677,2370"
listbox 160,9,62,65,listdir,list,tabstop
groupbox 160,75,62,51,"Options"
radiobutton 163,86,40,12,"N&ormal",nil,tabstop group
radiobutton 163,99,42,12,"Mi&nimize",icon,tabstop
checkbox 163,112,40,12,"&Watch",look,tabstop
defpushbutton 228,8,36,17,"&Open",tabstop group
pushbutton 228,28,36,17,"&Cancel",cancel,tabstop focus
pushbutton 228,48,36,17,"C&ompile",tabstop
pushbutton 228,68,36,17,"&Edit",tabstop
pushbutton 228,88,36,17,"&New",tabstop group
pushbutton 228,108,36,17,"&Delete",tabstop
enddialog
if choice=1 then {
dump=slice(listdir,list,",")
if length(dump)=0 then goto options
if right(dump,4)=".XWP" then scrap=dump:goto single
dirname=dump
current=upcase(dirname)
dirname=dirxwp+"\"+dirname:goto read_dir
}
if choice=2 then goto page1
if choice=3 then goto recompile
if choice=4 then goto edit1
if choice=5 then goto newdir
if choice=6 then {
dump=slice(listdir,list,",")
if length(dump)=0 then goto options
message "Press [ESC] to cancel."
topic="Confirm":mess="Delete "+dump+" ?":b1="&Ok":b2="&Cancel":gosub common2
if choice=2 then goto options
dump=dirxwp+"\"+dump
if exists(dump) then delete dump:goto options
}
-- Manual dial dialog. Rather than dial the number immediately, the script
-- assign a temporary variable (n19) to the number so that it may be inserted
-- into a queue, and recalled at a later point in a session.
LABEL MANUAL
message "Press [ESC] to cancel."
dialogbox 45,60,232,19
checkbox 3,3,28,12,"&Dial ",n19,tabstop
edittext 31,3,64,12,z,d19,focus
ltext 101,5,88,12,"with default settings"
defpushbutton 194,3,36,14,"Ok",ok,tabstop
enddialog
if choice=1 then {
if length(d19)=7 then d19=left(d19,3)+"-"+right(d19,4)
if length(d19)=11 then d19=left(d19,1)+"-"+right(d19,10):d19=left(d19,5)+"-"+right(d19,7):d19=left(d19,9)+"-"+right(d19,4)
z=d19
p19=d19
if n19=false then {
if length(p19)=0 then goto page1
new
redialcount=99
description=p19+" (manual entry)"
trap on
dial p19:if connected then alarm:show:display=on:end
if error then topic="Alert":mess="No connection or call cancelled.":gosub common1:trap off:goto page1
trap off:goto page1
}
if length(p19)=0 then topic="Error":mess="No number entered.":gosub common1:goto manual
goto page1
}
else goto page1
-- New directory list prompt dialog, on a profile-by-profile basis.
LABEL INCLUDE
dirfile=freefile
open output dirname as dirfile
close dirfile
open input dirname as dirfile
scrap=filefind(dirxwp + "\*.xwp")
while not null(scrap)
message "Press [ESC] to edit manually."
dialogbox 85,36,155,72
groupbox 7,4,94,63,"Options"
ltext 12,20,84,40,"Include "+scrap+" in new directory list?"
defpushbutton 111,8,36,17,"&Yes",ok,tabstop,focus
pushbutton 111,29,36,17,"&No",tabstop
pushbutton 111,50,36,17,"&Cancel",cancel,tabstop
enddialog
if choice=3 then close dirfile:goto read_dir
if choice=1 then {
load scrap
defxwp=name:defdesc=description
open append dirname as dirfile
write dirfile,defxwp,defdesc
}
close dirfile:new
scrap=filefind
wend
new
close dirfile:cls
new:return
-- First page of the edit dialog. Variables are copied to avoid loss of
-- changes when switching from page to page.
LABEL EDIT1
y10=p10:y11=p11:y12=p12:y13=p13:y14=p14:y15=p15:y16=p16:y17=p17:y18=p18
z10=d10:z11=d11:z12=d12:z13=d13:z14=d14:z15=d15:z16=d16:z17=d17:z18=d18
message "AutoList Editor (pg.1)"
dialogbox 36,16,250,132
edittext 4,4,39,12,p1,y1,tabstop focus
edittext 48,4,158,12,d1,z1,tabstop
edittext 4,18,39,12,p2,y2,tabstop
edittext 48,18,158,12,d2,z2,tabstop
edittext 4,32,39,12,p3,y3,tabstop
edittext 48,32,158,12,d3,z3,tabstop
edittext 4,46,39,12,p4,y4,tabstop
edittext 48,46,158,12,d4,z4,tabstop
edittext 4,60,39,12,p5,y5,tabstop
edittext 48,60,158,12,d5,z5,tabstop
edittext 4,74,39,12,p6,y6,tabstop
edittext 48,74,158,12,d6,z6,tabstop
edittext 4,88,39,12,p7,y7,tabstop
edittext 48,88,158,12,d7,z7,tabstop
edittext 4,102,39,12,p8,y8,tabstop
edittext 48,102,158,12,d8,z8,tabstop
edittext 4,116,39,12,p9,y9,tabstop
edittext 48,116,158,12,d9,z9,tabstop
ctext 210,2,36,8,"(Page 1)"
defpushbutton 210,29,36,17,"&Save",ok,tabstop group
pushbutton 210,49,36,17,"Pg&Dn",tabstop
pushbutton 210,69,36,17,"&Editor",tabstop
pushbutton 210,89,36,17,"&Cancel",tabstop
enddialog
if choice=4 then goto read_dir
if choice=3 then goto edit3
if choice=2 then {
p1=y1:p2=y2:p3=y3:p4=y4:p5=y5:p6=y6:p7=y7:p8=y8:p9=y9
d1=z1:d2=z2:d3=z3:d4=z4:d5=z5:d6=z6:d7=z7:d8=z8:d9=z9
goto edit2
}
if choice=1 then gosub writelist
goto read_dir
-- Second page of the edit dialog.
LABEL EDIT2
message "AutoList Editor (pg.2)"
dialogbox 36,16,250,132
edittext 4,4,39,12,p10,y10,tabstop focus
edittext 48,4,158,12,d10,z10,tabstop
edittext 4,18,39,12,p11,y11,tabstop
edittext 48,18,158,12,d11,z11,tabstop
edittext 4,32,39,12,p12,y12,tabstop
edittext 48,32,158,12,d12,z12,tabstop
edittext 4,46,39,12,p13,y13,tabstop
edittext 48,46,158,12,d13,z13,tabstop
edittext 4,60,39,12,p14,y14,tabstop
edittext 48,60,158,12,d14,z14,tabstop
edittext 4,74,39,12,p15,y15,tabstop
edittext 48,74,158,12,d15,z15,tabstop
edittext 4,88,39,12,p16,y16,tabstop
edittext 48,88,158,12,d16,z16,tabstop
edittext 4,102,39,12,p17,y17,tabstop
edittext 48,102,158,12,d17,z17,tabstop
edittext 4,116,39,12,p18,y18,tabstop
edittext 48,116,158,12,d18,z18,tabstop
ctext 210,2,36,8,"(Page 2)"
defpushbutton 210,29,36,17,"&Save",ok,tabstop group
pushbutton 210,49,36,17,"Pg&Up",tabstop
pushbutton 210,69,36,17,"&Editor",tabstop
pushbutton 210,89,36,17,"&Cancel",tabstop
enddialog
if choice=4 then goto read_dir
if choice=3 then goto edit3
if choice=2 then {
p10=y10:p11=y11:p12=y12:p13=y13:p14=y14:p15=y15:p16=y16:p17=y17:p18=y18
d10=z10:d11=z11:d12=z12:d13=z13:d14=z14:d15=z15:d16=z16:d17=z17:d18=z18
goto edit1
}
if choice=1 then gosub writelist
goto read_dir
-- Writes directory list changes.
LABEL WRITELIST
if exists(dirname) then delete dirname
if not exists(dirname) then {
message "Updating directory list, please wait..."
dirfile=freefile
open output dirname as dirfile
close dirfile
open append dirname as dirfile
write dirfile,y1,z1
write dirfile,y2,z2
write dirfile,y3,z3
write dirfile,y4,z4
write dirfile,y5,z5
write dirfile,y6,z6
write dirfile,y7,z7
write dirfile,y8,z8
write dirfile,y9,z9
write dirfile,y10,z10
write dirfile,y11,z11
write dirfile,y12,z12
write dirfile,y13,z13
write dirfile,y14,z14
write dirfile,y15,z15
write dirfile,y16,z16
write dirfile,y17,z17
write dirfile,y18,z18
close dirfile
}
return
-- Loads editor specified in the CrossTalk "System" options; if none
-- exists, then attempts to load the Windows Notepad.
LABEL EDIT3
message "Loading editor, please wait..."
if null(editor) then run "notepad.exe "+dirname
else run editor+" "+dirname:end
-- Rewrites the current directory by deleting the filename and then
-- chaining to the Include subroutine above.
LABEL RECOMPILE
message "Press [ESC] to cancel."
topic="Confirm":mess="Erase current directory list and recompile?":b1="&Ok":b2="&Cancel":gosub common2
if choice=2 then goto options
if choice=1 then {
if exists(dirname) then delete dirname
gosub include:goto read_dir
}
-- First page global tag. Only "real" entries are tagged.
LABEL TAG1
if length(p1)>0 then n1=true:if length(p2)>0 then n2=true:if length(p3)>0 then n3=true
if length(p4)>0 then n4=true:if length(p5)>0 then n5=true:if length(p6)>0 then n6=true
if length(p7)>0 then n7=true:if length(p8)>0 then n8=true:if length(p9)>0 then n9=true
goto page1
-- Second page global tag.
LABEL TAG2
if length(p10)>0 then n10=true:if length(p11)>0 then n11=true:if length(p12)>0 then n12=true
if length(p13)>0 then n13=true:if length(p14)>0 then n14=true:if length(p15)>0 then n15=true
if length(p16)>0 then n16=true:if length(p17)>0 then n17=true:if length(p18)>0 then n18=true
goto page2
-- Untags all entries.
LABEL UNTAG
n1=false:n2=false:n3=false:n4=false:n5=false:n6=false:n7=false:n8=false:n9=false
n10=false:n11=false:n12=false:n13=false:n14=false:n15=false:n16=false:n17=false:n18=false
n19=false
goto page1
-- Verifies profile and goes online, then chains to the Start subroutine below with
-- the actual number and description listed in the profile. If the "profile"
-- passed is a manually entered number (p19), default communications parameters are used.
LABEL TEST
recycleseconds=15
if num=p19 then {
new
number=p19
ddesc=number+" (manual entry)"
goto init
}
if inbook(num) then load num else topic="Error":mess="Cannot find "+num+".":gosub common1:goto page1
if look=false then display=off else display=on
ddesc=description
message "Dialing "+ddesc
trap on
go
watch 5 seconds for
"OK":wait 1 second:goto start
endwatch:topic="Error":mess="Probable modem problem.":gosub common1:goto page1
-- The recycling subroutine itself, which sends the active profile name to
-- the Test subroutine above. The counter is arbitrarily set to 99 retries.
LABEL QUEUE
if icon=true then minimize
while not online or not connected {
repeat
x=x+1
if n1=true then num=p1:gosub test
if n2=true then num=p2:gosub test
if n3=true then num=p3:gosub test
if n4=true then num=p4:gosub test
if n5=true then num=p5:gosub test
if n6=true then num=p6:gosub test
if n7=true then num=p7:gosub test
if n8=true then num=p8:gosub test
if n9=true then num=p9:gosub test
if n10=true then num=p10:gosub test
if n11=true then num=p11:gosub test
if n12=true then num=p12:gosub test
if n13=true then num=p13:gosub test
if n14=true then num=p14:gosub test
if n15=true then num=p15:gosub test
if n16=true then num=p16:gosub test
if n17=true then num=p17:gosub test
if n18=true then num=p18:gosub test
if n19=true then num=p19:gosub test
until x=99
alarm:alarm:alarm:show
topic="Alert":mess="No connections were made.":gosub common1:cls:new:goto page1
}
wend
-- The actual direct-address modem dialing routine and results watch. The direct-
-- address approach must be used when multiple numbers have been selected to inhibit
-- the foreground appearance of CrossTalk's "Dialing - " message box when CrossTalk
-- is running as a background task; otherwise relative transparency in background
-- cycling through profiles would not be possible.
-- Thanks to S. Jenkins for sharing his superior number parsing routine with me.
LABEL START
reply modeminit
scrap=upcase(number)
if instr(scrap,';') then scrap=slice(scrap,1,';')
if instr(scrap,'X') then scrap=strip(scrap,'X')
else if instr(scrap,'L') then scrap=ldnumber+strip(scrap,'L')
else scrap=outnumber+scrap
if instr(dialprefix,'AT') then scrap=insert(dialprefix,modifier,instr(dialprefix,'AT')+2)+scrap+dialsuffix
else scrap=dialprefix+scrap+dialsuffix
reply scrap;
watch for
"CONNECT":goto bingo
"BUSY":message "Busy":return
"NO CARRIER":message "No Carrier":return
"NO DIAL":topic="Error":mess="No dial tone.":gosub common1:cls:new:goto page1
"ERROR":topic="Error":mess="Probable modem problem.":gosub common1:cls:new:goto page1
KEY 27:show:message "Dialing queue cancelled, please wait...":bye:n19=false:cls:new:goto page1
endwatch
trap off:bye
-- This routine uses CrossTalk's native "call" or "dial" statements, in the
-- event only a single number or profile has been selected.
LABEL SINGLE
trap on
if exists(scrap) then load scrap else new:redialcount=99
if length(number)>0 then {
dial number
if connected then alarm:alarm:alarm:show:chain script:end
trap off:goto page1
}
else call scrap
if connected then end else new:goto page1
-- This subroutine checks whether one or more selections have been made and
-- then chains to the appropriate Single or multiple Queue subroutine above.
LABEL CHECKLIST
x=0
if n1=true and length(p1)>0 then x=x+1:scrap=p1
if n2=true and length(p2)>0 then x=x+1:scrap=p2
if n3=true and length(p3)>0 then x=x+1:scrap=p3
if n4=true and length(p4)>0 then x=x+1:scrap=p4
if n5=true and length(p5)>0 then x=x+1:scrap=p5
if n6=true and length(p6)>0 then x=x+1:scrap=p6
if n7=true and length(p7)>0 then x=x+1:scrap=p7
if n8=true and length(p8)>0 then x=x+1:scrap=p8
if n9=true and length(p9)>0 then x=x+1:scrap=p9
if n10=true and length(p10)>0 then x=x+1:scrap=p10
if n11=true and length(p11)>0 then x=x+1:scrap=p11
if n12=true and length(p12)>0 then x=x+1:scrap=p12
if n13=true and length(p13)>0 then x=x+1:scrap=p13
if n14=true and length(p14)>0 then x=x+1:scrap=p14
if n15=true and length(p15)>0 then x=x+1:scrap=p15
if n16=true and length(p16)>0 then x=x+1:scrap=p16
if n17=true and length(p17)>0 then x=x+1:scrap=p17
if n18=true and length(p18)>0 then x=x+1:scrap=p18
if n19=true and length(p19)>0 then x=x+1:scrap=p19
if x=0 then topic="Alert":mess="No number(s) selected.":gosub common1:goto page1
if x=1 then goto single
if x>1 then goto queue
-- The create new directory list dialog box.
LABEL NEWDIR
message "Press [ESC] to cancel."
dialogbox 45,60,232,19
ltext 3,5,28,12,"Create "
edittext 31,3,39,12,z,dump,focus
ltext 73,5,98,12,".DIR as a new directory."
defpushbutton 194,3,36,14,"Ok",ok,tabstop
enddialog
if choice=1 then {
if length(dump)=0 then goto options
if length(dump)>8 then {
topic="Error":mess="Invalid file name.":gosub common1:goto newdir
}
else dump=upcase(dump)+".DIR"
dirname=dump
current=upcase(dirname)
dirname=dirxwp+"\"+dirname
gosub include:goto read_dir
-- The global single button message box.
LABEL COMMON1
dialogbox 85,36,155,72
groupbox 7,4,94,63,topic
ltext 12,20,84,40,mess
defpushbutton 111,27,36,17,"&Ok",ok,tabstop,focus
enddialog
return
-- The global two-button dialog box.
LABEL COMMON2
dialogbox 85,36,155,72
groupbox 7,4,94,63,topic
ltext 12,20,84,40,mess
defpushbutton 111,17,36,17,b1,ok,tabstop,focus
pushbutton 111,41,36,17,b2,cancel,tabstop
enddialog
return
-- Connection made subroutine restores CrossTalk to the foreground and
-- its original window size if iconized, and terminates the script.
LABEL BINGO
restore
message "Connected to "+ddesc
alarm:alarm:alarm
chain script:end
-- The exit options dialog box.
LABEL FINISH
if connected then bye
display=on
cls
message "AutoList Exit Options"
dialogbox 85,36,155,72
ctext 10,8,133,11,"Close AutoList and exit to:"
defpushbutton 10,47,134,18,"&Cancel",cancel,tabstop,focus
pushbutton 10,24,63,18,"Cross&Talk",tabstop
pushbutton 81,24,63,18,"&Windows",tabstop
enddialog
if choice=1 then goto page1
if choice=2 then new:end
if choice=3 then terminate